//
//  YBUserInfoModel.m
//  ZhongWangYuanApp
//
//  Created by apple on 18/6/2.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "YBUserInfoModel.h"

@implementation YBUserInfoModel
- (NSString *)description{
    return [self yy_modelDescription];
}

- (BOOL)isCloudyAutonomouslyChooseStudy{
    for (NSString *chooseStudy in self.roleList) {
        if ([chooseStudy isEqualToString:@"自主选学"]) {
            return YES;
        }
    }
    return NO;
}

//-(NSString *)name
//{
//    return [_name stringByRemovingPercentEncoding];
//}


+(void)ybChangeUserInfoWithKey:(NSString *)key value:(id)value
{
    YBUserInfoModel * model = [YBUserInfoModel yy_modelWithJSON:[[NSUserDefaults standardUserDefaults] objectForKey:@"loginUser"]];
    [model setValue:value forKey:key];
    [[NSUserDefaults standardUserDefaults] setObject:[model yy_modelToJSONObject] forKey:@"loginUser"];
}


@end
